package com.yan.service;

import java.util.List;

import com.yan.controller.viewModel.login.UserModel;
import com.yan.controller.viewModel.looker.BookInfo;
import com.yan.controller.viewModel.looker.BookRatingInfo;
import com.yan.controller.viewModel.user.BorrowInfo;
import com.yan.controller.viewModel.user.ReserveInfo;
import com.yan.controller.viewModel.user.SuggestBuyInfo;
import com.yan.controller.viewModel.user.UserInfo;
import com.yan.vo.Page;

public interface BooksService
{
	//查询所有书籍
//List<Books> getAllBooks(Books book);
	Page getAllBooks(BookInfo book);
	//借阅书籍
	BookInfo getBook(Integer id);
	//确认借阅书籍
	void insertBorrow(BorrowInfo borrow);
	//查询借阅的书籍
	Page getBorrows(BorrowInfo borrow);
	//查询需要归还的书籍
	Page getBacks(BorrowInfo borrow);
	//申请归还
	void updateBacks(Integer id);
	//预定信息
	void insertReserve(ReserveInfo reserve);
	//查询预定书籍信息
	List<ReserveInfo> getReserveBook(Integer id);
	//查询是否存在用户
	UserModel selectUser(UserModel user);
	//用户借书减少书籍数量
	/*void updateBooks(Integer id);*/
	
	//建构表插入图书信息
	void insertSuggest(SuggestBuyInfo suggest);
	
	//查询个人信息
	UserInfo selectPersonMessage(int uid);
	
	//更新个人信息
	void updatePersonMessage(UserInfo personMessage);
	
	//插入查询记录
	void insertSelectInfo(BookInfo book) throws InstantiationException, IllegalAccessException;
	
	//由还书id查询书的信息
	BookInfo selectBackedBook(Integer id);
	
	//插入评分信息
	void insertBookPingFen(BookRatingInfo bookrating);
	
	//更新借书表图书为评分状态
	void updateBackBookPingFen(Integer id);
	
	//查询评分表
	List<BookRatingInfo> selectBookRating(Integer bookid);
	
	//游客页面图书推荐查询
	List<BookRatingInfo> selectBookTuijian();
	
	//用户图书推荐查询
	List<BookRatingInfo> selectBookTuijian1(int userid);
	
	//点赞操作
	String clickUp(int uid, int bkid, int suid);
	//点踩操作
	String clickDown(int uid, int bkid, int suid);
}
